package hu.rsc.feeds.client.dnd;

import hu.rsc.feeds.client.data.UserCategory;
import hu.rsc.feeds.client.gui.RssWidget;

import com.google.gwt.user.client.ui.AbsolutePanel;

public class DropTarget extends AbsolutePanel {
    private int x;
    private int y;
    private UserCategory userCategory;
    private RssWidget content;

    public DropTarget(int x, int y, UserCategory usercCategory) {
	super();
	this.x = x;
	this.y = y;
	this.userCategory = usercCategory;
	addStyleName("cell");
	addStyleName("border");
    }

    public void addContent(RssWidget content) {
	clear();
	this.content = content;
	if (content == null) {
	    return;
	}
	this.content.setPosition(this.x, this.y);
	this.content.setUserCategory(this.userCategory);
	add(content);
    }

    public RssWidget getContent() {
	return this.content;
    }

    public void nullContent() {
	this.content = this.content;
    }

}
